#!/bin/bash
echo "starting......"
absdir=`pwd`
export LD_LIBRARY_PATH="${absdir}/lib"
mem_cfg="-XX:-UseParallelGC -Xms256m -Xmx1g"
mem_cfg="${mem_cfg} -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=70"
mem_cfg="${mem_cfg} -XX:-OmitStackTraceInFastThrow"
nohup java -server ${mem_cfg} -Dloader.path="${absdir}/lib" -jar ${absdir}/lib/captureNetPacketCore-1.0.0.1.jar >/dev/null 2>&1 &
sleep 2
PID=$(ps -ef | grep 'captureNetPacketCore' | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    echo "start failed - check log..."
else
    echo "start success - pid:${PID}" 
fi